import sys
import re

filename = sys.argv[1]
in_f = open(filename,"rb")
out_f = open("out.csv", "wb")

for line in in_f.readlines():
    outline = '{\"'+line
    str_list=list(outline)
    pos = str_list.index(',')
    str_list.insert(pos, '\"')
    pos = str_list.index('\r')
    str_list.insert(pos, '},')
    outline = "".join(str_list)
    print(outline) 
    out_f.write(outline)
